using System.Security.Permissions;
using System.Web;
using System.Web.UI.WebControls;

namespace CodeStory.WebControls
{
	public delegate void TreeGridCommandEventHandler(object sender,TreeGridCommandEventArgs e);

	[AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
	[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
	public class TreeGridCommandEventArgs : CommandEventArgs
	{
		// Fields
		private object _commandSource;
		private TreeGridRow _row;

		// Methods
		public TreeGridCommandEventArgs(object commandSource, CommandEventArgs originalArgs) : base(originalArgs) {
			this._commandSource = commandSource;
		}

		public TreeGridCommandEventArgs(TreeGridRow row, object commandSource, CommandEventArgs originalArgs) : base(originalArgs) {
			this._row = row;
			this._commandSource = commandSource;
		}

		// Properties
		public object CommandSource {
			get { return this._commandSource; }
		}

		internal TreeGridRow Row {
			get { return this._row; }
		}
	}
}